package org.liuyunfeng.web;

import org.apache.catalina.Context;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @author: TanJingyu
 * @create: 2022-03-08 10:57
 **/
@RequestMapping("/html")
@Controller
public class HtmlController {

    @GetMapping("/index")
    public String index(HttpServletRequest request) {
        String domain = request.getRequestURL().toString().replace(request.getScheme() + "://", "").replace(request.getRequestURI(), "").replace(":" + request.getServerPort(), "");
        System.out.println(domain);
        return "/index.html";
    }

    @GetMapping("/goods")
    public String goodsHtml(HttpServletRequest request, Context context) {
        String domain = request.getRequestURL().toString().replace(request.getScheme() + "://", "").replace(request.getRequestURI(), "").replace(":" + request.getServerPort(), "");
        System.out.println(domain);
        request.getSession(true);
        return "/goods.html";
    }
}

    